package com.dy.placeOrder2.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pojo.Goods;
import org.apache.ibatis.annotations.Select;


/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-11-19
 */

public interface GoodsMapper extends BaseMapper<Goods> {

    @Select("select g.*,s.specification from goods g JOIN speci s on g.cid=s.gid where g.id=#{id} LIMIT 1")
    Goods findById(Integer id);

    @Select("SELECT * from goods g JOIN speci s on g.cid=s.gid where g.id=#{id} limit 1")
    Goods find(Integer id);

//    @Select("SELECT * from goods g JOIN speci s on g.cid=s.gid")
//    Page<Goods> findAll(Page<Goods> page, LambdaQueryWrapper<Goods> wrapper);
}
